/*
 * @Author: hongbin
 * @Date: 2023-05-26 22:40:02
 * @LastEditors: hongbin
 * @LastEditTime: 2023-06-10 22:15:16
 * @Description:
 */
import { ShaderMaterial } from "three/src/materials/ShaderMaterial";
import vertexShader from "./vt.glsl";
import fragmentShader from "./fm.glsl";

export class HideMaterial extends ShaderMaterial {
    constructor(params: {
        axis: number;
        axisLength: number;
        process: number;
        reverse?: number;
    }) {
        const uniforms = {
            axis: { value: params.axis },
            axisLength: { value: params.axisLength },
            process: { value: params.process },
            reverse: { value: params.reverse || 0 },
        };

        super({
            vertexShader,
            fragmentShader,
            uniforms,
        });
    }
}
